package myfirstgrailsproject

/**
* These provide a set of g: tags to be used in the gsp's.
* These tags are related to login actions.
*
* @author zach
*
*/
class LoginTagLib {

	def loginControl = {
		if (request.getSession(false) && session.user){
			out << "Hello, ${session.user.firstName}. "
			out << """[${link(action:"logout", controller:"user"){"Logout"}}]"""
		}
		else{
			out << """[${link(action:"login", controller:"user"){"Login"}}]"""
		}

	}
	

}
